package org.dsapr;

public class Game {
	private int playgroundWidth = 40;
	private int playgroundHeight = 90;
	public static int loop = 1;
	private Playground playground;

	public Game() {
		this.creatPlayground();
	}

	public void play() {
		boolean finished = false;

		while(!finished) {
			this.playground.start();
			loop += 1;
		}

	}

	private void creatPlayground() {

		if (System.getProperty("pWidth") != null && System.getProperty("pHeight") != null) {
			playgroundWidth =  Integer.parseInt(System.getProperty("pWidth"));
			playgroundHeight =  Integer.parseInt(System.getProperty("pHeight"));
		}

		this.playground = new Playground(playgroundWidth, playgroundHeight);
		Grid grid = new Grid();
		this.playground.setGrid(grid);
	}
}
